package Commons;

import java.util.logging.Level;

import Constant.IctwebConstant;
import Exception.IctwebException;

public class ConfigIctweb {


	private static ConfigIctweb instance = null;

	public static ConfigIctweb getInstance() throws IctwebException {
		if (instance == null) {
			instance = new ConfigIctweb();
		}
		return instance;
	}

	public static void initConfig() throws IctwebException {
		instance = new ConfigIctweb();
	}

	public ConfigIctweb() throws IctwebException {
		this.initParameters();
	}

	private void initParameters() throws IctwebException {

		String applicationHome = System.getProperty(IctwebConstant.VAR_HOME_DIR);

		if (applicationHome == null) {
			LoggerUtilis.logIctWeb.log(Level.WARNING,"variable d'environnement java pushgen_home non initialis\351e dans la JVM");
			 throw new IctwebException("variable d'environnement java pushgen_home non initialis\351e dans la JVM " + applicationHome);
		}
		LoggerUtilis.logIctWeb.log(Level.INFO,"repertoire variable d'environnement ictweb.home : "+applicationHome);

	}
}


